]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
StTextureCache: do not monitor files inside GResource
authorCosimo Cecchi <cosimo@endlessm.com>
Wed, 4 Feb 2015 20:23:30 +0000 (12:23 -0800)
committerCosimo Cecchi <cosimoc@gnome.org>
Wed, 4 Feb 2015 21:18:49 +0000 (13:18 -0800)
This is wasteful, since GResource does not support file monitoring.
Further, doing so will trigger a fallback code path in GLib that polls
every second in a thread, which is doubly wasteful.

https://bugzilla.gnome.org/show_bug.cgi?id=744013

src/st/st-texture-cache.c

index d392844103c78e8c3617d6c8e340cdb132759151..5cc48e3fd036c0f01a765245bb0db5e1ac66e863 100644 (file)
@@ -983,6 +983,12 @@ ensure_monitor_for_file (StTextureCache *cache,
 {
   StTextureCachePrivate *priv = cache->priv;
 
+  /* No point in trying to monitor files that are part of a
+   * GResource, since it does not support file monitoring.
+   */
+  if (g_file_has_uri_scheme (file, "resource"))
+    return;
+
   if (g_hash_table_lookup (priv->file_monitors, file) == NULL)
     {
       GFileMonitor *monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE,